package com.bw.shop2208a.db

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy.REPLACE
import androidx.room.Query
import androidx.room.Update
import com.bw.shop2208a.entity.DataUserResult

@Dao
interface UserDao {
    @Insert(onConflict = 1)
    suspend fun insertUser(userResult: DataUserResult)
    @Update
    suspend fun updateUser(userResult: DataUserResult)
    @Delete
    suspend fun deleteUser(userResult: DataUserResult)
    @Query("delete from user_info")
    suspend fun deleteAll()
    @Query("select*from user_info")
    suspend fun getUser():List<DataUserResult>
    @Query("select*from user_info where id = :id")
    suspend fun getUserById(id:Int):DataUserResult?
}